home *** CD-ROM | disk | FTP | other *** search
- Makefile and SCCS/RCS on SGI Computer Systems
- ---------------------------------------------
-
- TABLE OF CONTENTS:
-
- 1. Make(1) and SCCS
- 2. Pmake(1) and SCCS
- 3. Make(1) and RCS
- 4. Pmake(1) and RCS
- 5. ftp location of GNUmake
-
- ------------------------------------------------------------------------------
- ------------------------------------------------------------------------------
- 1. Make(1) and SCCS
-
- Some customers have found that when porting to SGI, make(1) does not work the
- same as they are familiar. For example, the SVR4 make(1) that SGI ships
- requires SCCS files be in the current directory even if using the macro VPATH,
- unlike public domain gnumake (reportedly). Make won't use VPATH to find
- source (dependency) files where the only connection between the source and
- target file is an internal make rule.
-
- Also, according to the make(1) man page:
-
- If the macro VPATH is set and contains a colon separated list of
- directories, then if a dependency is not found in the current directory
- it is searched for in the specified alternate directories. Targets are
- treated similarly. Note that VPATH does not affect any of the internal
- macros (e.g $@, $*, etc.). This means that VPATH is primarily useful
- when the source is in the current directory and the objects are in other
- directories.
-
- A solution that some people use to retain the ability for make(1) to compare
- the time stamp against a source file and its SCCS archive existing in a
- different directory is shown below.
-
- Create a Makefile that contains:
- ------------------------------
- # Makefile for testing make(1) and sccs(1) files in a different directory
-
- SHELL=/bin/sh
-
- CFILES = hello.c
- OBJECTS = hello.o
-
- hello: $(OBJECTS)
- cc $(OBJECTS) -o hello
-
- $(CFILES): SCCS/s.$$@
- sccs get -s $@
- ------------------------------
-
- Note that the white space before the "cc..." and "sccs get ..." above needs
- to be a tab character. Now, try the following two tests to see that the
- latest revision of hello.c is always used during the make.
-
- test1:
- -----
- echo "main() { printf ("\""Hello world.\\n"\""); }" > hello.c
- mkdir SCCS
- sccs create hello.c
- rm -f hello.c
- make
-
-
- test2:
- -----
- mv hello.c hello.c.bak
- sccs edit hello.c
- echo "/* comment */" >> hello.c
- sccs delta -y hello.c
- mv hello.c.bak hello.c
- make
-
- In test2, use mv instead of cp to preserve time stamp of older revision.
-
-
- ------------------------------------------------------------------------------
- 2. Pmake(1) and SCCS
-
- Pmake is a more powerful make utility, unfortunately as mentioned on the
- pmake(1) manual page, pmake doesn't have make(1)'s tilde rules for SCCS files.
-
-
- ------------------------------------------------------------------------------
- 3. Make(1) and RCS
-
- The same reason that a source file needs to be in the same directory as its
- SCCS file affects make(1) and RCS files. Pmake is preferred in order to have
- the make compare the time stamp against a source file and its RCS archive
- existing in a different directory. See the next section for an example of how
- to easily use pmake for this purpose.
-
-
- ------------------------------------------------------------------------------
- 4. Pmake(1) and RCS
-
- With pmake it is easy to "make" the latest revision of a source file under RCS
- revision control where its rcs file is in another directory.
-
- From the pmake(1) manual page:
-
- pmake also supports the notion of multiple directories in a more
- flexible, easily-used manner than has been available in the past. You
- can define a list of directories in which to search for any and all files
- that aren't in the current directory by giving the directories as sources
- to the .PATH target. The search will only be conducted for those files
- used only as sources, on the assumption that files used as targets will
- be created in the current directory.
-
- The line
- .PATH : RCS
- would tell pmake to look for any files it is seeking (including ones made
- up by means of transformation rules) in the RCS directory as well as the
- current one. Note, however, that this searching is only done if the file
- is used only as a source in the makefile; the file cannot be created by
- commands in the makefile.
-
-
- To see that pmake compares the time stamps of a file under revision source
- control with its rcs file in another directory, do the following.
-
-
-
-
-
-
-
-
-
- Create a Makefile that contains:
- ------------------------------
- #!/usr/sbin/pmake
- # Makefile for testing pmake(1) and rcs(1) files in a different directory.
-
- SHELL=/bin/sh
- .PATH : RCS
-
- hello: hello.o
- cc hello.o -o hello
-
- hello.o: hello.c
- cc -c hello.c
- ------------------------------
-
- Note that the white space before the "cc..." above in both places needs
- to be a tab character. Now, try the following two tests to see that the
- latest revision of hello.c is always used during the make.
-
- test1:
- -----
- echo "main() { printf ("\""Hello world.\\n"\""); }" > hello.c
- mkdir RCS
- echo "Testing make and rcs" | ci hello.c
- pmake [or "make"; make works because of the first line in the Makefile]
-
- test2:
- -----
- mv hello.c hello.c.bak
- co -l hello.c
- echo "/* comment */" >> hello.c
- ci -m"Added Comment" hello.c
- mv hello.c.bak hello.c
- pmake
-
- In test2, use mv instead of cp to preserve time stamp of older revision.
-
-
- ------------------------------------------------------------------------------
- 5. ftp location of gnumake
-
- SGI makes no claims on the availability or quality of gnumake. Gnumake
- is reported to not require the SCCS file be in the same directory as the
- source in order for the gnumake to succeed. The public domain gnumake
- can be ftp-ed via anonymous ftp login from prep.ai.mit.edu:/pub/gnu.
-